#！/bin/bash

IP=localhost
SERVER_PORT=5534
SOCKET_PORT=5544
DBIP=localhost
REDIS=localhost

# 程序名, 修改此处
PROGNAME='yorick_springboot.jar'
prog_num=`netstat -lntp | grep ${SERVER_PORT} | grep -v grep | wc -l`
if [ "$prog_num" -eq "0" ] ; then
echo "----------启动中----------"
chmod 777 $PROGNAME
nohup java -jar yorick_springboot.jar --server.port=${SERVER_PORT} --socket.ip=${IP} --socket.port:${SOCKET_PORT}  --spring.datasource.url="jdbc:mysql://${DBIP}:3306/yorick_manage?characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT" --redis.host=${REDIS} & 1>nohup.out 2>&1
echo "----------启动成功----------"
else
echo "----------程序已启动----------"
fi
